package com.hkemmm.configs;

import com.hkemmm.bean.UserInfoBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration  //表示该类为配置类
@ComponentScan(basePackages = "com.hkemmm")  //注解扫描范围（控制范围）
public class AppConfig {
    @Bean("userInfoBean")
    public UserInfoBean provideUserInfoBean(){
        UserInfoBean userInfoBean = new UserInfoBean();

        userInfoBean.setUserName("小红");

        return userInfoBean;
    }
}
